using System;
using System.IO;

namespace Kopernikus.Parsing.AST
{
    public class ASTTerminalNode : ASTNode
    {
        private readonly IConvertToSymbol m_symbol;

        public ASTTerminalNode(IConvertToSymbol symbol)
        {
            m_symbol = symbol;
        }

        public override IConvertToSymbol Token
        {
            get { return m_symbol; }
        }

        public override Symbol Symbol
        {
            get { return m_symbol.Symbol; }
        }

        public override int ChildCount
        {
            get { return 0; }
        }

        public override ASTNode this[int index]
        {
            get { throw new NotImplementedException(); }
        }

        public override void PrettyPrint(TextWriter writer, int level)
        {
            writer.Write(m_symbol.ToString());
        }
    }
}